Skip to content

fix(cli): make dispatch storage locks portable - #1894

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/dispatch-windows-store
Jul 30, 2026
Merged

fix(cli): make dispatch storage locks portable#1894
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/dispatch-windows-store

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

Summary

  • replace the Windows no-op Dispatch locks with the workspace's existing cross-platform file-lock implementation
  • recover incomplete event-log tails through read/write handles and an explicit append position
  • keep retention non-blocking, skip active jobs, and retry Windows sharing violations on a later collection pass
  • make the process-identity cancellation test platform-independent without adding Windows detached-worker support

Root cause

The Windows lock helper reported success without acquiring a lock. Event logs were opened in append mode even though recovery needs truncation, retention attempted to rename a directory while its lock file was still open, and one cancellation test depended on Unix-only process behavior.

Scope

  • no storage schema, lock path, wire contract, or public API changes
  • no Windows detached-worker implementation
  • no new runtime or process-management abstraction

Verification

  • cargo test -q -p bitfun-cli (476 unit tests plus all CLI integration suites)
  • cargo check --workspace
  • node scripts/check-core-boundaries.mjs
  • node scripts/check-repo-hygiene.mjs
  • git diff HEAD^ --check
  • rustfmt --edition 2021 --check src/apps/cli/src/dispatch/mod.rs src/apps/cli/src/dispatch/store.rs

Use the existing fs2 dependency for real cross-process locks, recover incomplete event tails with a writable handle, and defer busy retention cleanup safely on Windows. Keep detached worker support limited to Linux and macOS.
@limityan
limityan merged commit 9bdf34a into GCWing:main Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant